package com.hospital.hospitalmedicalrecordservice.web;


import com.hospital.common.vo.ResultEntity;
import com.hospital.hospitalmedicalrecordservice.entity.Registration;
import com.hospital.hospitalmedicalrecordservice.entity.Vipperson;
import com.hospital.hospitalmedicalrecordservice.service.IRegistrationService;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 挂号记录表 前端控制器
 * </p>
 *
 * @author 韩天雨
 * @since 2020-10-28
 */
@RestController
@RequestMapping("/registration")
public class RegistrationController {
@Autowired
    IRegistrationService iRegistrationService;
    @RequestMapping("/regnum")
    public ResultEntity regnum(){
        Date date=new Date();
        //System.out.println(date);
        String newDateStr = DateFormatUtils.format(date,"yyyy-MM-dd");
        List<Registration> vipnum = iRegistrationService.regnum(newDateStr);
        return ResultEntity.ok(vipnum.size());
    }

}
